package 笔试.隽思信息;

public class 路径总数 {
    public static void main(String[] args) {
        int x = 6;
        int y = 6;
        System.out.println(solve(x, y));
    }

    private static int solve(int x, int y) {
        int[][] dp = new int[x][y];
        for (int i = 0; i < x; i++) {
            dp[i][0] = 1;
        }
        for (int j = 0; j < y; j++) {
            dp[0][j] = 1;
        }
        for (int i = 1; i < x; i++) {
            for (int j = 1; j < y; j++) {
                dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
            }
        }
        return dp[x - 1][y - 1];
    }
}